Skip to content

Fix and improve MovingWindow examples in docs - #368

Merged
leandro-lucarella-frequenz merged 3 commits into
frequenz-floss:v0.x.xfrom
llucax:fix-doc
Apr 28, 2023
Merged

Fix and improve MovingWindow examples in docs#368
leandro-lucarella-frequenz merged 3 commits into
frequenz-floss:v0.x.xfrom
llucax:fix-doc

Conversation

@leandro-lucarella-frequenz

Copy link
Copy Markdown
Contributor
  • Fix example formatting
  • Add proper python markers to examples
  • Improve examples formatting

llucax added 3 commits April 28, 2023 10:16
The code block wasn't properly terminated, causing the generated
documentation to be completely wrong, interpreting part of the
documentation as code.

Signed-off-by: Leandro Lucarella <leandro.lucarella@frequenz.com>
This makes the examples be properly syntax highlighted when rendered.

Signed-off-by: Leandro Lucarella <leandro.lucarella@frequenz.com>
When each example is in its own `Example:` block with a proper title,
they are also rendered in their own block with a nice title, which makes
it much easier to read.

Signed-off-by: Leandro Lucarella <leandro.lucarella@frequenz.com>
@leandro-lucarella-frequenz
leandro-lucarella-frequenz requested a review from a team as a code owner April 28, 2023 08:22
@github-actions github-actions Bot added the part:data-pipeline Affects the data pipeline label Apr 28, 2023
@leandro-lucarella-frequenz leandro-lucarella-frequenz changed the title Fix and improve MovingWindow docs Fix and improve MovingWindow examples in docs Apr 28, 2023
@leandro-lucarella-frequenz leandro-lucarella-frequenz added this to the v0.21.0 milestone Apr 28, 2023
@leandro-lucarella-frequenz

Copy link
Copy Markdown
Contributor Author

The fix is for this:

image

And this is how it looks after the improvements in formatting:

image

@leandro-lucarella-frequenz

Copy link
Copy Markdown
Contributor Author

Ah, one catch, the final output doesn't say "Example: ..." but just "..." because then it renders with a custom title it doesn't add the "Example: " too, just the 🧪 icon. I tried putting Example: Example: ... in the docstring but it looked really weird and like an error, so I guess it is likely that someone will "fix it" at some point, so I was more comfortable with this balance between nice rendered docs and docs in the source that don't look completely weird.

@leandro-lucarella-frequenz

Copy link
Copy Markdown
Contributor Author

So this is how the output with this PR looks like:

image

@leandro-lucarella-frequenz
leandro-lucarella-frequenz added this pull request to the merge queue Apr 28, 2023
Merged via the queue into frequenz-floss:v0.x.x with commit 27fad89 Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:data-pipeline Affects the data pipeline

Projects

Development

Successfully merging this pull request may close these issues.

4 participants